import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import http from '@/libs/http'
import { isAuth } from '@/libs/auth'
import { ResultMessage } from "@/libs/response"
import * as filters from '@/libs/filters'
import PubSub from 'pubsub-js'
import BaiduMap from 'vue-baidu-map'

// import NPlayer from "@nplayer/vue";

import '@wangeditor/editor/dist/css/style.css'

import '@/assets/styles/index.scss'
import '@/assets/styles/layout.scss'

import Screenfull from "screenfull";
// import VueI18n from 'vue-i18n'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/assets/iconfont/iconfont.css'
import '@/assets/styles/fonts.scss'

// Element UI i18n 国际化
// import enLocale from 'element-ui/lib/locale/lang/en'
// import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
// import en from '@/i18n/en'
// import zh from '@/i18n/zh'

// 注册全局过滤器
Object.keys(filters).forEach(key => {
    Vue.filter(key, filters[key])
})

// 国际化
// Vue.use(VueI18n)
// const i18n = new VueI18n({
//     locale: 'zh',
//     messages: {
//         en: Object.assign(en, enLocale),
//         zh: Object.assign(zh, zhLocale)
//     },
// })
// Vue.use(ElementUI, {
//     i18n: (key, value) => i18n.t(key, value)
// })
Vue.use(ElementUI)

Vue.use(BaiduMap, {
    // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
    ak: '1f648c12a2709a14b0e79551fdc5f791'
})

// Vue.use(NPlayer);

/**
 * 全局属性
 */
Vue.prototype.$Screenfull = Screenfull
Vue.prototype.$http = http
Vue.prototype.isAuth = isAuth
Vue.prototype.ResultMessage = ResultMessage
Vue.prototype.$echarts = window.echarts
Vue.prototype.PubSub = PubSub

Vue.config.productionTip = false
new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
